Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanded GetFiles / File Search with RecipientFileStatus #276

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

RagnarFatland-Avanade
Copy link
Collaborator

@RagnarFatland-Avanade RagnarFatland-Avanade commented Jan 11, 2024

Description

  • Expanded GetFiles / File Search to be able to use RecipientFileStatus s as a search parameter.
  • Added new policy for GetFiles to allow it to be used by both Senders and Recipients.
  • Updated most policies to be able to handle tokens containing multiple scopes

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Ragnar Inge Fatland added 2 commits January 11, 2024 19:40
…us as a search parameter.

- Added ny policy for GetFiles to allow it to be used by both Senders and Recipients.
- Updated most policies to be able to handle tokens containing multiple scopes
@RagnarFatland-Avanade
Copy link
Collaborator Author

A case comes in mind; what to do if a user that only has "sender" access attempts to search using RecipientFileStatus?
In the current implementation, they should simply receive an empty search result.
Should we respond with Forbidden?

Copy link
Collaborator

@Ceredron Ceredron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Contributor

@tomshag tomshag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Maybe I'm blind but does this change include setting default Get request to set RecipientStatus to initialized?

@tomshag
Copy link
Contributor

tomshag commented Jan 12, 2024

A case comes in mind; what to do if a user that only has "sender" access attempts to search using RecipientFileStatus? In the current implementation, they should simply receive an empty search result. Should we respond with Forbidden?

If a user only has sender access, should the request not simply ignore RecipientFileStatus if it is supplied?

@RagnarFatland-Avanade
Copy link
Collaborator Author

Looks good. Maybe I'm blind but does this change include setting default Get request to set RecipientStatus to initialized?

Thanks!
The Get should not set any defaults as-is.
I debated with myself if I should set defaults we originally discussed, but found it would obfuscate/limit the search functionality.
The absence of a search parameter indicates that you do not wish to filter on that value/field; overriding that choice with a default seems limiting to me.
We could expand the enums to include a value like "dontFilterOnThis" but seems less intuitive.

@RagnarFatland-Avanade
Copy link
Collaborator Author

A case comes in mind; what to do if a user that only has "sender" access attempts to search using RecipientFileStatus? In the current implementation, they should simply receive an empty search result. Should we respond with Forbidden?

If a user only has sender access, should the request not simply ignore RecipientFileStatus if it is supplied?

I think ignoring a specified filter makes a similar inconsistency that setting default value for non-specified filters; obfuscating the search.
I will leave it as-is until we get some experience with the use.

@RagnarFatland-Avanade RagnarFatland-Avanade merged commit feae50c into main Jan 12, 2024
@RagnarFatland-Avanade RagnarFatland-Avanade deleted the Feature/filesearch-with-recipientstatus branch January 12, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants